package com.yh.dp.principle.lsp;

/**
 * @ClassName Client
 * @Description 启动类
 * @Author 0715-YuHao
 * @Date 2021/1/3 15:00
 */
public class Client {

    public static void main(String[] args) {
        //定义一个士兵实例对象
        Soldier soldier = new Soldier();
        //为这个士兵配枪:手枪
        soldier.setGun(new Pistol());
        soldier.killEnemy();

        //定义一个狙击手实例对象
        Sniper sniper = new Sniper();
        sniper.setGun(new AWM());
        sniper.killEnemy();
    }
}
